﻿using System;
using System.IO;
using BookiFramework.Files;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace BookiFramework.net45.Test
{
    [TestClass]
    public class FileReaderTest
    {
        public const string File = "Demo.txt";
        public const string Content = "Demo";
        [TestMethod]
        public void Test_read_file_success()
        {
            //Arrange
            var fileReader = new FileReader();

            //Act
            var result = fileReader.ReadTextFromFile(File);

            //Assert
            Assert.AreEqual(Content,result);
        }
        [TestMethod,ExpectedException(typeof(FileNotFoundException))]
        public void Test_read_file_error()
        {
            //Arrange
            var fileReader = new FileReader();

            //Act
            var result = fileReader.ReadTextFromFile("cualquier ruta.noexisto");

            //Assert
            Assert.Inconclusive();
        }
    }
}
